package com.java.business.jxc.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.java.business.jxc.bean.B_MATERIAL;
import com.java.business.jxc.dao.MaterialMapper;
import com.java.core.utils.IdUtils;

@Transactional
@Service
public class MaterialService {

	@Autowired
	private MaterialMapper mapper;

	public void add(B_MATERIAL material) {
		material.setMaterial_id(IdUtils.uuid());
		mapper.add(material);
	}

	public void update(B_MATERIAL material) {
		mapper.update(material);
	}

	public void setDisabled(B_MATERIAL material) {
		mapper.setDisabled(material);
	}

	public void delete(String material_code) {
		mapper.delete(material_code);
	}

	public B_MATERIAL getMaterialById(String material_code) {
		return mapper.getMaterialById(material_code);
	}

	public List<B_MATERIAL> getMaterialList(B_MATERIAL material) {
		return mapper.getMaterialList(material);
	}
}
